import storage from '@/utils/storage'
import router from '@/router'
import { ElMessageBox, ElMessage } from 'element-plus'
export function handleLoginOut() {
  ElMessageBox.confirm('确定要退出登录?', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  })
    .then(() => {
      ;(ElMessage as any)({
        message: '退出登录成功',
        type: 'success'
      })
      storage.removeStorage('token')
      storage.removeStorage('userInfo')
      storage.removeStorage('userMenus')
      router.push('/login')
    })
    .catch(() => {
      console.log('取消')
    })
}
